﻿@using Study_MVC.ViewModels
@model CreateEmployeeViewModel
@{
    Layout = null;
}
<script src="~/Scripts/Validations.js"></script>
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>CreateEmployee</title>
</head>
<body>
    <div>
        <form action="/Employee/SaveEmployee" method="post">
            <table>
                <tr>
                    <td>
                        First Name:
                    </td>
                    <td>
                        <input type="text" id="TxtFName" name="FirstName" value="@Model.FirstName" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="right">
                        @Html.ValidationMessage("FirstName")
                    </td>
                </tr>
                <tr>
                    <td>
                        Last Name:
                    </td>
                    <td>
                        <input type="text" id="TxtLName" name="LastName" value="@Model.LastName" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="right">
                        @Html.ValidationMessage("LastName")
                    </td>
                </tr>

                <tr>
                    <td>
                        Salary:
                    </td>
                    <td>
                        <input type="text" id="TxtSalary" name="Salary" value="@Model.Salary" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="right">
                        @Html.ValidationMessage("Salary")
                    </td>
                </tr>

                <tr>
                    <td colspan="2">
                        <input type="submit" name="BtnSubmit" value="Save Employee"  onclick="return IsValid();" />
                        <input type="submit" name="BtnSubmit" value="Cancel" />
                        <input type="button" name="BtnReset" value="Reset" onclick="ResetForm();" />
                    </td>
                </tr>
            </table>
        </form>
    </div>
</body>

</html>
<script>
    function ResetForm() {
        document.getElementById('TxtFName').value = "";
        document.getElementById('TxtLName').value = "";
        document.getElementById('TxtSalary').value = "";
    }
</script>